package com.example.demo.common;
/* @Author      zouzh
 * @PackageName BlogSystem-sm
 * @Package     com.example.demo.common
 * @Date        2023/9/6 15:37
 */

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 统一异常处理
 */
//@RestControllerAdvice
public class ExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public ResultAjax doException(Exception e){
        return ResultAjax.fail(-1,e.getMessage());
    }
}
